package com.atguigu.gmall.feign.order;


import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.order.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@RequestMapping("/api/inner/order")
@FeignClient("service-order")
public interface OrderFeignClient {


    /**
     * 生成订单确认页的订单流水追踪防重令牌
     * @return
     */
    @GetMapping("/gen/tradeno")
    Result<String> generateOrderTradeNo();


    /**
     * 查询用户的指定订单信息
     * @param orderId
     * @return
     */
    @GetMapping("/info/{orderId}")
    Result<OrderInfo> getOrderInfo(@PathVariable("orderId") Long orderId);


    /**
     * 获取指定的秒杀单数据
     * @param code
     * @param skuId
     * @return
     */
    @GetMapping("/seckill/order")
    Result<OrderInfo> getSeckillOrderInfo(
            @RequestParam("code") String code,
            @RequestParam("skuId") Long skuId);
}
